#ifndef _AHT10_H_
#define _AHT10_H_

#include "sys.h"
#include "delay.h"

#define SDA GPIO_Pin_7
#define SCL GPIO_Pin_6
#define I2C_Prot GPIOB

#define SDA_High GPIO_SetBits(I2C_Prot,SDA)
#define SDA_Low GPIO_ResetBits(I2C_Prot,SDA)

#define SCL_High GPIO_SetBits(I2C_Prot,SCL)
#define SCL_Low GPIO_ResetBits(I2C_Prot,SCL)

#define OUT 1
#define INPUT 0

void AHT_I2C_UserConfig(void);
void AHT_I2C_Start(void);
void AHT_I2C_Stop(void);
u8   AHT_I2C_Write_Ack(void);
void AHT_I2C_Write_Byte(u8 Data);
u8   AHT_I2C_Read_Data(void);
void AHT_I2C_Sende_Ack(u8 ack);



#define AHT_ADDRESS 0X70 //0X38
#define AHT_WRITE   0X70
#define AHT_READ    0X71 //0X39

extern u8 ACK,DATA[6];

u8    AHT10_State(void);
void  AHT10_Write_Reset(void);
u8    AHT10_Read_Humi_Temp(float *HUMI, float *TEMP);
 
#endif

